<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath()+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 		<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/updateVideo.css" />
        <link rel="stylesheet" href="<%=basePath %>/css/list.css">
		<link href="<%=basePath %>/css/H-ui.min.css" rel="stylesheet" type="text/css" />
		<link href="<%=basePath %>/css/formsCSS.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/simditor.css" />
		<script src="<%=basePath%>/lib/My97DatePicker/WdatePicker.js"></script>
		<script src="<%=basePath %>/js/jquery.min.js"></script>
		<script src="<%=basePath %>/js/formsJS.js"></script>
		 <!-- kindeditor富文本编辑器 -->
		<link href="<%=basePath%>/kindeditor/themes/default/default.css">
		<link href="<%=basePath%>/kindeditor/plugins/code/prettify.css">
		<script src="<%=basePath%>/kindeditor/lang/zh-CN.js"></script>
		<script src="<%=basePath%>/kindeditor/kindeditor-all.js"></script>

<script type="text/javascript">

function checkForm(f){

	if(f.cardName.value.replace(/\s/g,'') == ''){
		alert("年卡名称不能为空");
		return false;
	}
	if(f.cardStatus.value.replace(/\s/g,'') == ''){
		alert("年卡状态不能为空");
		return false;
	}
 
	return true;
}

</script>
</head>
<body>
		<div class="connect_wrap">
    		<h3 style= "text-align: center;">年卡信息维护</h3>
			<div class="row cl" style="max-width:88%;margin-left:8%;">
			<div class="labelText"></div>
				<form action="<%=basePath%>/vipCard/vipCardEdit" method="post" onsubmit="return checkForm(this)"
					enctype="multipart/form-data">
					<div class="col-sm-4"></div>
	    					<div class="col-sm-4">
	    							<div class="boxs">
												<input type="hidden" name="id" value="${vipCard.id}">
												<input type="text" class="inputBox" placeholder="年卡名称" name="cardName" value="${vipCard.cardName}" >
											<%-- 	<input type="number" class="inputBox" placeholder="年卡数量" name="cardNum" value="${vipCard.cardNum}" > --%>
												<select id="cardStatus" name="cardStatus" class="selectBox"  >
												  	<option value="">年卡状态</option>
												  	<option value="0" ${vipCard.cardStatus == 0 ? 'selected="seelcted"' : '' }>停用</option>
												  	<option value="1" ${vipCard.cardStatus == 1 ? 'selected="seelcted"' : '' }>启用</option>
										  			
												</select>
											    <input type="text" placeholder="创建时间" class="name Wdate inputBox" name="createTime" value="${vipCard.createTime}" 
											    		onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"><br /><br />
											    		
											     <input type="file" class="inputBox" placeholder="年卡图片" name="imgFile" value="${vipCard.cardImg}" >
											     		
											     <input type="text" class="inputBox" placeholder="年卡活动价" name="cardPrice" value="${vipCard.cardPrice}" >
											     <input type="text" class="inputBox" placeholder="年卡原价" name="cardOrignalPrice" value="${vipCard.cardOrignalPrice}" >
											     
				    						     <input type="text" class="inputBox" placeholder="年卡介绍" name="cardDesc" value="${vipCard.cardDesc}" >
												<br>
 												<textarea  id="cardDetail" placeholder="年卡详情" name="cardDetail" class="inputBox kindeditor" style="width: 90%;">${vipCard.cardDetail}</textarea>
												 
												
												<input type="submit" value="确定" class="true" />
												<input type="button"  class="false" value="取消" onclick="window.history.go(-1)">
										</div>
								</div>
					</form>
			</div>
	</div>
	
</body>
	 <script type="text/javascript">
	
	var editor;
 	KindEditor.ready(function(K) {
 		
 	    editor = K.create('#cardDetail', {
 	            uploadJson : '<%=basePath%>kindeditor/upload',       
 	            fillDescAfterUploadImage: false,
 	            allowImageRemote:false,
 	            afterCreate : function() {
 	                var self = this;
 	                K.ctrl(document, 13, function() {
 	                    self.sync();
 	                });
 	                K.ctrl(self.edit.doc, 13, function() {
 	                    self.sync();
 	                });
 	            },
 	            afterBlur:function(){ 
 	                this.sync(); 
 	            } 
 	        });
 	});  

</script>
	 
</html>